package com.cskaoyan.dbutils.resultsethandler;

import com.cskaoyan.connectionpool.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ColumnListHandler;

import java.sql.SQLException;
import java.util.List;

public class ColumnListHandlerDemo {

    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner();

        List<String> list = queryRunner.query(DruidUtils.getConnection(),"select name from city", new ColumnListHandler<String>());

        System.out.println(list);

    }
}
